<?php
/**
 * view: task/index
 * @var CSService\Controller\Task
 * @var \Ke\Web\Context $this
 * @var \Ke\Web\Web     $web
 * @var string          $content
 */


$logs = $this->logs ?? [];
?>
<table class="ui table selectable compact">
	<thead>
	<tr>
		<th>id</th>
		<th>用户</th>
		<th>项目</th>
		<th>服务器</th>
		<th>命令</th>
		<th>执行时间</th>
		<th></th>
	</tr>
	</thead>
	<tbody>
	<?php
	/** @var \CSService\Model\Task\Task_Log $log */
	foreach ($logs as $log) {
		?>
		<tr>
			<td><?php print $log->id ?></td>
			<td><?php print $log->user_name ?></td>
			<td><?php print $log->project_name; ?></td>
			<td><?php print $log->lan_ip; ?></td>
			<td><?php print $log->command_name; ?></td>
			<td><?php print date('Y-m-d H:i:s', $log->created_at); ?></td>
			<td>
				<a href="<?php print $this->web->uri("task/log_detail/{$log->id}", ['ref' => $web->http->uri]) ?>" class="mini ui button basic">详情</a>
			</td>
		</tr>
		<?php
	}
	?>
	</tbody>
</table>
<?php $this->component('pager',
	['page' => $this->page, 'pageSize' => $this->pageSize, 'pageCount' => $this->pageCount]); ?>
